qui {
	capture program drop ccn_beta_delta_het_newsym
	local count=0
	local subsample = "$subsample"
	local modelname = "$modelname"
	foreach lhs in $LHSlist { 
		local controls="${CONTROLlist_`lhs'_wage}"
		local beta_controls "${BETA_control_list}"
		local delta_controls "${DELTA_control_list}"
		foreach rhs in $RHSlist { 
			foreach robust in $robust_list {
				forvalues K=$K_list {
					noisily display "LHS=`lhs', RHS=`rhs', SE=`robust', K=`K', $S_DATE, $S_TIME"
					qui {
					local count=`count'+1
					matrix actual_estimates_mat = J(1,39,-9)
					mat colnames actual_estimates_mat = const_hettobit beta1_hettobit beta2_hettobit beta3_hettobit beta4_hettobit beta5_hettobit ///
						d_const_hettobit d_delta1_hettobit d_delta2_hettobit ///
						const_symm beta1_symm beta2_symm beta3_symm beta4_symm beta5_symm ///
						d_const_symm d_delta1_symm d_delta2_symm ///		
						const_hetuni beta1_hetuni beta2_hetuni beta3_hetuni beta4_hetuni beta5_hetuni ///
						d_const_hetuni d_delta1_hetuni d_delta2_hetuni ///
						const_none beta1_none beta2_none beta3_none beta4_none beta5_none ///
						cont_naive beta1_naive beta2_naive beta3_naive beta4_naive beta5_naive

					local rowcounter = 1
					local i = 1
					use "$datapath/003_cluster_`subsample'_`lhs'.dta", clear
					local control_length = 0
					foreach control of varlist `controls' {
						local control_length = `control_length' + 1
					}
					global control_length = `control_length'
					qui tab X_`K', generate(dumX_`K'_)

					*Het Tobit
					qui ccn_beta_delta_het_newsym het_tobit `K' `rhs' `lhs' `robust' "`controls'" het_tobit 1 "`beta_controls'" "`delta_controls'" 0
					matrix actual_estimates_mat[`rowcounter',1] = COEFFS[1,4] // constant
					matrix actual_estimates_mat[`rowcounter',2] = COEFFS[1,5] // beta1
					matrix actual_estimates_mat[`rowcounter',3] = COEFFS[1,6] // beta2
					matrix actual_estimates_mat[`rowcounter',4] = COEFFS[1,7] // beta3
					matrix actual_estimates_mat[`rowcounter',5] = COEFFS[1,8] // beta4
					matrix actual_estimates_mat[`rowcounter',6] = COEFFS[1,9] // beta5
					matrix actual_estimates_mat[`rowcounter',7] = COEFFS[1,1] // Delta0
					matrix actual_estimates_mat[`rowcounter',8] = COEFFS[1,2] // Delta1
					matrix actual_estimates_mat[`rowcounter',9] = COEFFS[1,3] // Delta2

					*Symmetric;
					qui ccn_beta_delta_het_newsym symmetric `K' `rhs' `lhs' `robust' "`controls'" het_tobit 1 "`beta_controls'" "`delta_controls'" 0
					matrix actual_estimates_mat[`rowcounter',10] = COEFFS[1,4] // constant
					matrix actual_estimates_mat[`rowcounter',11] = COEFFS[1,5] // beta1
					matrix actual_estimates_mat[`rowcounter',12] = COEFFS[1,6] // beta2
					matrix actual_estimates_mat[`rowcounter',13] = COEFFS[1,7] // beta3
					matrix actual_estimates_mat[`rowcounter',14] = COEFFS[1,8] // beta4
					matrix actual_estimates_mat[`rowcounter',15] = COEFFS[1,9] // beta5
					matrix actual_estimates_mat[`rowcounter',16] = COEFFS[1,1] // Delta0
					matrix actual_estimates_mat[`rowcounter',17] = COEFFS[1,2] // Delta1
					matrix actual_estimates_mat[`rowcounter',18] = COEFFS[1,3] // Delta2
					
					*Uniform
					qui ccn_beta_delta_het_newsym het_uniform `K' `rhs' `lhs' `robust' "`controls'" het_tobit 1 "`beta_controls'" "`delta_controls'" 0
					matrix actual_estimates_mat[`rowcounter',19] = COEFFS[1,4] // constant
					matrix actual_estimates_mat[`rowcounter',20] = COEFFS[1,5] // beta1
					matrix actual_estimates_mat[`rowcounter',21] = COEFFS[1,6] // beta2
					matrix actual_estimates_mat[`rowcounter',22] = COEFFS[1,7] // beta3
					matrix actual_estimates_mat[`rowcounter',23] = COEFFS[1,8] // beta4
					matrix actual_estimates_mat[`rowcounter',24] = COEFFS[1,9] // beta5
					matrix actual_estimates_mat[`rowcounter',25] = COEFFS[1,1] // Delta0
					matrix actual_estimates_mat[`rowcounter',26] = COEFFS[1,2] // Delta1
					matrix actual_estimates_mat[`rowcounter',27] = COEFFS[1,3] // Delta2
					
					*No Controls
					qui ccn_beta_delta_het_newsym naiveN `K' `rhs' `lhs' `robust' "`controls'" het_tobit 1 "`beta_controls'" "`delta_controls'" 0
					matrix actual_estimates_mat[`rowcounter',28] = COEFFS[1,1] // constant
					matrix actual_estimates_mat[`rowcounter',29] = COEFFS[1,2] // beta1
					matrix actual_estimates_mat[`rowcounter',30] = COEFFS[1,3] // beta2
					matrix actual_estimates_mat[`rowcounter',31] = COEFFS[1,4] // beta3
					matrix actual_estimates_mat[`rowcounter',32] = COEFFS[1,5] // beta4
					matrix actual_estimates_mat[`rowcounter',33] = COEFFS[1,6] // beta5
					
					*Naive
					qui ccn_beta_delta_het_newsym naive `K' `rhs' `lhs' `robust' "`controls'" het_tobit 1 "`beta_controls'" "`delta_controls'" 0
					matrix actual_estimates_mat[`rowcounter',34] = COEFFS[1,1] // constant
					matrix actual_estimates_mat[`rowcounter',35] = COEFFS[1,2] // beta1
					matrix actual_estimates_mat[`rowcounter',36] = COEFFS[1,3] // beta2
					matrix actual_estimates_mat[`rowcounter',37] = COEFFS[1,4] // beta3
					matrix actual_estimates_mat[`rowcounter',38] = COEFFS[1,5] // beta4
					matrix actual_estimates_mat[`rowcounter',39] = COEFFS[1,6] // beta5

					local rowcounter = `rowcounter'+1
					local i = `i' + 1

					clear
					noisily matrix list actual_estimates_mat
					qui svmat actual_estimates_mat, names(col)
					gen LHS="`lhs'"
					gen RHS="`rhs'"
					gen Kcluster=`K'
					gen Robust="`robust'"
					save "$datapath/004_het_beta5_delta2_results_`subsample'_`modelname'_`lhs'_`robust'_K`K'.dta", replace
					}
				}
			}
		}			
	}

}
